---
title: Batch Prediction job definitions
description: How to submit a working Batch Prediction job. You must supply a variety of elements to the POST request payload depending on the type of prediction.

---

# Batch Prediction job definitions {: #batch-prediction-job-definitions }

To submit a working Batch Prediction job, you must supply a variety of elements to the `POST` request payload depending on what type of prediction is required. Additionally, you must consider the type of intake and output adapters used for a given job.

For more information about Batch Prediction REST API routes, view the [DataRobot REST API reference documentation](public-api/predictions).

<!--private start-->
You can also access the legacy [REST API documentation](https://app.datarobot.com/apidocs/index.html){ target=_blank }.
<!--private end-->

Every time you make a Batch Prediction, the prediction information is stored outside DataRobot and re-submitted for each prediction request, as described in detail in the [sample use cases section](pred-examples). One such request could be as follows:

`POST https://app.datarobot.com/api/v2/batchPredictions`

```json
{
    "deploymentId": "<deployment_id>",
    "intakeSettings": {
        "type": "dataset",
        "datasetId": "<dataset_ud>"
    },
    "outputSettings": {
        "type": "jdbc",
        "statementType": "insert",
        "credentialId": "<credential_id>",
        "dataStoreId": "<data_store_id>",
        "schema": "public",
        "table": "example_table",
        "createTableIfNotExists": false
    },
    "includeProbabilities": true,
    "includePredictionStatus": true,
    "passthroughColumnsSet": "all"
}
```

## Job Definitions API {: #job-definitions-api }

If your use case requires the same, or close to the same, type of prediction to be done multiple times, you can choose to create a _Job Definition_ of the Batch Prediction job and store this inside DataRobot for future use.

The API for job definitions is identical to the existing `/batchPredictions/` endpoint, and can be used interchangeably by changing the `POST` endpoint to `/batchPredictionJobDefinitions`:

`POST https://app.datarobot.com/api/v2/batchPredictionJobDefinitions`

```json
{
    "deploymentId": "<deployment_id>",
    "intakeSettings": {
        "type": "dataset",
        "datasetId": "<dataset_ud>"
    },
    "outputSettings": {
        "type": "jdbc",
        "statementType": "insert",
        "credentialId": "<credential_id>",
        "dataStoreId": "<data_store_id>",
        "schema": "public",
        "table": "example_table",
        "createTableIfNotExists": false
    },
    "includeProbabilities": true,
    "includePredictionStatus": true,
    "passthroughColumnsSet": "all"
}
```

This definition endpoint will return an accepted payload that verifies the successful storing of the definition to DataRobot.

Optionally, you can supply a `name` parameter for easier identification. If you don't supply one, DataRobot will create one for you.

!!! warning
    The <code>name</code> parameter must be unique across your organization. If you attempt to create multiple definitions with the same name, the request will fail. If you wish to free up a name, you must first send a <code>DELETE</code> request with the existing job definition ID you wish to delete.

## Execute a Job Definition {: #execute-a-job-definition }

If you wish to submit a stored job definition for scoring, you can either choose to do so on a scheduled basis, described [here](job-scheduling.md), or by manually submitting the definition ID to the endpoint `/batchPredictions/fromJobDefinition` and with the definition ID as the payload, as such:

`POST https://app.datarobot.com/api/v2/batchPredictions/fromJobDefinition`

```json
{
    "jobDefinitionId": "<job_definition_id>"
}
```

The endpoint supports regular the CRUD operations, `GET`, `POST`, `DELETE` and `PATCH`.
